package action.article;

import java.util.List;
import java.util.Map;

import org.apache.struts2.ServletActionContext;

import bean.User;

import com.opensymphony.xwork2.ActionSupport;

import dao.ArticleClassDao;

public class AddArticleAction extends ActionSupport {
	private ArticleClassDao articleClassDao;
	@Override
	public String execute() throws Exception {
		Map session=ServletActionContext.getContext().getSession();
		User u=(User) session.get("user");
		if(u==null)
			return INPUT;
		List l=articleClassDao.findArticleClassesByUserid(u.getId());
		System.out.println(l.size());
		ServletActionContext.getRequest().setAttribute("articleClasses", l);
		return SUCCESS;
	}
	public ArticleClassDao getArticleClassDao() {
		return articleClassDao;
	}
	public void setArticleClassDao(ArticleClassDao articleClassDao) {
		this.articleClassDao = articleClassDao;
	}
	
}
